#include <stdio.h>

#include "common.h"
#include "mem_handler.h"
#include "cic.h"

int main(const int argc, const char* argv[])
{
	if (argc != 3)
	{
		printf("usage: %s rom_dump input_stream\n", argv[0]);
		return EXIT_FAILURE;
	}

	if (!rom_load(argv[1]))
		return EXIT_FAILURE;

	u8 stream[0x20000];
	if (!stream_load(argv[2], stream))
		return EXIT_FAILURE;

	cic_run(0x80000, stream);

	rom_unload();

	return EXIT_SUCCESS;
}
